package com.dyh.quickdemo.plugin.u2;


import lombok.extern.slf4j.Slf4j;

import java.util.function.Consumer;

@Slf4j
public  class CoreItemService {

    public Consumer consumer;

    public static CoreItemService with(Consumer consumer){
        CoreItemService service = new CoreItemService();
        service.consumer =consumer;
        return service;
    }

    public int trigger(Long id){
      log.info("触发{}",id);

      Object dbData = new Object();
      if (dbData==null){
          return 0;
      }

      consumer.accept("ad");
      return 1;
    }
}
